package com.gome.oa.util;

import java.awt.Component;

import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;

/**
 *
 * @author: tang li
 * @date: 2016年8月21日
 * @desc: 
 *
 */
public class SwingUtil {

	public static void alert(final Component owner, final String message, final JTextField field) {
		SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
            	JOptionPane.showConfirmDialog(owner, message, "信息提示", JOptionPane.DEFAULT_OPTION);
            	if(field != null) {
            		field.requestFocus();
            	}
            }
        });
	}
}
